package com.wn.service.Impl;

import com.wn.dao.RoleDao;
import com.wn.entity.RbacRole;
import com.wn.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RoleServiceImpl implements RoleService {
    @Autowired
    private RoleDao roleDao;

    @Override
    public void insert(RbacRole role) {
        role.setStatus(role.ENABLE);
        roleDao.insert(role);
    }

    @Override
    public List<RbacRole> getAll() {
        return roleDao.getAll();
    }

    @Override
    public RbacRole selectId(Integer id) {
        return roleDao.selectId(id);
    }

    @Override
    public void deleteId(Integer id) {
        roleDao.deleteId(id);
    }

    @Override
    public void UpdateRole(RbacRole role) {
        roleDao.UpdateRole(role);
    }
}
